statusbar: Add an element name to the css node
authorMatthias Clasen <mclasen@redhat.com>
Thu, 29 Oct 2015 11:01:57 +0000 (07:01 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 29 Oct 2015 11:01:57 +0000 (07:01 -0400)
This lets us avoid hardcoding the type in CSS.

gtk/gtkstatusbar.c

index 9cb3106670c1853d5dd71b69c717b154a6894d73..b5ee3244f43995bc2d8aef4b36a242cc046caab6 100644 (file)
  * gtk_statusbar_pop(). A message can be removed from anywhere in the
  * stack if its message id was recorded at the time it was added. This
  * is done using gtk_statusbar_remove().
+ *
+ * # CSS node
+ *
+ * GtkStatusbar has a single CSS node with name statusbar.
  */
+
 typedef struct _GtkStatusbarMsg GtkStatusbarMsg;
 
 struct _GtkStatusbarPrivate
@@ -176,6 +181,7 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
   gtk_widget_class_bind_template_child_private (widget_class, GtkStatusbar, label);
 
   gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_STATUSBAR_ACCESSIBLE);
+  gtk_widget_class_set_css_name (widget_class, "statusbar");
 }
 
 static void
@@ -183,14 +189,10 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
 {
   GtkStatusbarPrivate *priv;
   GtkShadowType shadow_type;
-  GtkStyleContext *context;
 
   statusbar->priv = gtk_statusbar_get_instance_private (statusbar);
   priv = statusbar->priv;
 
-  context = gtk_widget_get_style_context (GTK_WIDGET (statusbar));
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_STATUSBAR);
-
   priv->seq_context_id = 1;
   priv->seq_message_id = 1;
   priv->messages = NULL;